import request from '@/utils/request'

// 获取医生排班信息
export function getSchedulesByDeptAndDate(deptId,date) {
  return request({
    url: '/schedules/schedules/getSchedulesByDeptAndDate',
    method: 'get',
    params: { deptId, date }
  })
}

// 获取医生排班信息
export function  getDoctorSchedules(doctorId) {
  return request({
    url: '/schedules/schedules/getDoctorSchedules',
    method: 'get',
    params: { doctorId }
  })
}

// 更新号源接口
export function updateQuota(doctorId, appointmentDate, timeSlot, change) {
  return request({
    url: '/schedules/schedules/updateQuota',
    method: 'put',
    params: { doctorId, appointmentDate, timeSlot, change }
  })
}

// 获取所有排班信息
export function getAllSchedules() {
  return request({
    url: '/schedules/schedules/getAllSchedules',
    method: 'get'
  })
}

// 查询排班信息列表
export function listSchedules(query) {
  return request({
    url: '/schedules/schedules/list',
    method: 'get',
    params: query
  })
}

// 查询排班信息详细
export function getSchedules(scheduleId) {
  return request({
    url: '/schedules/schedules/' + scheduleId,
    method: 'get'
  })
}

// 新增排班信息
export function addSchedules(data) {
  return request({
    url: '/schedules/schedules',
    method: 'post',
    data: data
  })
}

// 修改排班信息
export function updateSchedules(data) {
  return request({
    url: '/schedules/schedules',
    method: 'put',
    data: data
  })
}

// 删除排班信息
export function delSchedules(scheduleId) {
  return request({
    url: '/schedules/schedules/' + scheduleId,
    method: 'delete'
  })
}
